pull: Fix crash specifying override URL in summary fetch
authorDan Nicholson <nicholson@endlessm.com>
Wed, 3 May 2017 16:31:58 +0000 (11:31 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 3 May 2017 18:08:37 +0000 (18:08 +0000)
The summary URL override is looked up with "&s", which directly
exchanges the data to a pointer without allocation. This was causing a
segfault calling ostree_repo_remote_fetch_summary_with_options from
pygobject.

Closes: #829
Approved by: jlebon

src/libostree/ostree-repo-pull.c

index 2cfa2e86c38caa67c040c48853cc2907d0043e77..35598eca257c2092ef2b3c30aabc97369167e964 100644 (file)
@@ -2459,7 +2459,7 @@ repo_remote_fetch_summary (OstreeRepo    *self,
   g_autoptr(GMainContext) mainctx = NULL;
   gboolean ret = FALSE;
   gboolean from_cache = FALSE;
-  g_autofree char *url_override = NULL;
+  const char *url_override = NULL;
   g_autoptr(GPtrArray) mirrorlist = NULL;
 
   if (options)